#pragma once

namespace raytrace {

struct Vector3;
typedef const Vector3& Vector3Arg;

struct Vector3 {
  Vector3();
  Vector3(Vector3Arg v);
  Vector3(float x, float y, float z);

  void normalize();

  float length_sqr() const;

  float x_;
  float y_;
  float z_;

  static const Vector3 origin;

  static float dot(Vector3Arg a, Vector3Arg b);
  static Vector3 cross(Vector3Arg a, Vector3Arg b);
  static Vector3 add(Vector3Arg a, Vector3Arg b);
  static Vector3 sub(Vector3Arg a, Vector3Arg b);
  static Vector3 mul(Vector3Arg a, Vector3Arg b);
  static Vector3 div(Vector3Arg a, Vector3Arg b);
  static Vector3 scale(Vector3Arg a, float s);
  static Vector3 scale(float s, Vector3Arg a);
};


}
